package com.eas.biz.framework;

public class BaseQuery {

    private int start;

    private int pageNumber;

    private int pageSize;

    private String sortBy;

    private String sort;

    public void formatPagination() {
        if (pageNumber > 0 && pageSize > 0) {
            start = (pageNumber - 1) * pageSize;
        } else {
            start = -1;
        }
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getStart() {
        return start;
    }

    public String getSortBy() {
        return sortBy;
    }

    public void setSortBy(String sortBy) {
        this.sortBy = sortBy;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

}
